#include <string>
#include <iostream>
#include <sys/types.h>
#include <memory>


#include "HttpServer.hpp"
#include "Log.hpp"

using std::cout;
using std::endl;

static void Usage(char* proc)
{
    cout << "\nUsage:" << proc << " port\n" << endl;
}

int main(int argc, char* argv[])
{
    //LOG(DEBUG, "debug log");
    if(argc != 2)
    {
        Usage(argv[0]);
        exit(-1);
    }
    
    int16_t port = atoi(argv[1]);
    std::shared_ptr<HttpServer> httpServer(new HttpServer(port));
    httpServer->Init();
    httpServer->Loop();

    return 0;
}